
#include "mine_monitor_stack_info.h"

TaskHandle_t stackHeapAnalysisTaskHandler;

/* RTOS 任务函数 */
void stack_heap_analysis_task(void *param)
{
    UBaseType_t result; // UBaseType_t  unsigned long
    while (1)
    {
        // result = uxTaskGetStackHighWaterMark(mine_fly_control_task_handler);
        // printf("[mine_fly_control_task_handler]  stack minial left: %ld\n", result);
        // vTaskDelay(1000);

        result = uxTaskGetStackHighWaterMark(mine_remoter_ctrl_task_handler);
        printf("[mine_remoter_ctrl_task_handler]  stack minial left: %ld\n", result);
        vTaskDelay(100);
    }
}

/* 出现堆栈溢出则打印输出溢出的任务是哪一个 */
//configCHECK_FOR_STACK_OVERFLOW
// void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName)
// {
//     printf("[ERROR][StackOverFlow] task: %s\n", pcTaskName);
// }
